package com.erp.erp_servers.Message.imp;

import com.erp.erp_dao.Message.IMessageUserDetailDAO;
import com.erp.erp_entitys.Message.MessageUserDetail;
import com.erp.erp_entitys.Message.MessageUserDetailExample;
import com.erp.erp_entitys.Message.UserUnReadGroupTypeRes;
import com.erp.erp_servers.Message.IMessageUserDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zjk
 * @version 1.0
 * @description
 * @date 2021-11-21 23:27
 */
@Service
public class ImpMessageUserDetailService implements IMessageUserDetailService {

    private final IMessageUserDetailDAO messageUserDetailDao;

    public ImpMessageUserDetailService(IMessageUserDetailDAO messageUserDetailDao) {
        this.messageUserDetailDao = messageUserDetailDao;
    }

    @Override
    public int deleteByExample(MessageUserDetailExample example) {
        return messageUserDetailDao.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return messageUserDetailDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(MessageUserDetail record) {
        return messageUserDetailDao.insert(record);
    }

    @Override
    public int insertSelective(MessageUserDetail record) {
        return messageUserDetailDao.insertSelective(record);
    }

    @Override
    public List<MessageUserDetail> selectByExample(MessageUserDetailExample example) {
        return messageUserDetailDao.selectByExample(example);
    }

    @Override
    public MessageUserDetail selectByPrimaryKey(Integer id) {
        return messageUserDetailDao.selectByPrimaryKey(id);
    }


    @Override
    public int updateByPrimaryKeySelective(MessageUserDetail record) {
        return messageUserDetailDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(MessageUserDetail record) {
        return messageUserDetailDao.updateByPrimaryKey(record);
    }

    @Override
    public UserUnReadGroupTypeRes queryUnReadByType(String userCode) {
        return messageUserDetailDao.queryUnReadByType(userCode);
    }

    @Override
    public int updateMessageReadStatus(List<Integer> ids, String receiverCode) {
        return messageUserDetailDao.updateMessageReadStatus(ids,receiverCode);
    }
}
